package common;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

public class Object {
    private static EdgeDriver edgeDriver;
    private static EdgeOptions options;

    public static EdgeDriver getEdgeDriver() {
        if (edgeDriver == null) {
            WebDriverManager.edgedriver().setup();
            //配置一下选项-允许访问所有链接
            options = new EdgeOptions();
            options.addArguments("--remote-allow-origins=*");
            edgeDriver = new EdgeDriver(options);
        }
        return edgeDriver;
    }
}
